package light.im.userserver.action;

import org.json.JSONObject;

import light.im.ActionName;
import light.im.IAction;
import light.im.IMSession;
import light.network.Protocol;
import light.network.object.PackObject;

@ActionName("userinf")
public class UserInfoAction implements IAction {

	@Override
	public void execute(IMSession session, PackObject req) {
		try
		{
			PackObject po = new PackObject();
			JSONObject h = po.getHeader();
			h.put("result", Protocol.OK);
			h.put("id", "ruby").put("name", "Ruby").put("nickname", "万里独行");
			
			session.write(po);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

}
